package com.gopay.solution.dao.impl;

import java.io.Serializable;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.gopay.solution.domain.po.SsAcctGainDtl;

/**
 * 方案服务 账户收益方案明细
 * 
 * @SsAcctGainDtlDAOImpl.java
 * @author liujy
 * @2013-3-26 上午11:05:44 www.gopay.com.cn Inc.All rights reserved.
 */
@Repository("ssAcctGainDtlDAO")
public class SsAcctGainDtlDAOImpl extends SolutionRuleDtlDAOImpl<SsAcctGainDtl, Serializable> {

    @Override
    public SsAcctGainDtl getByPk(Serializable id) {
        return find(SsAcctGainDtl.class, id);
    }

    @Override
    public List<SsAcctGainDtl> listBySolutionId(long solutionId) {
        String hql = "from SsAcctGainDtl where solutionId = " + solutionId;
        return findByHql(hql);
    }

    @Override
    public boolean delBySolutionId(long solutionId) {

        List<SsAcctGainDtl> dtls = listBySolutionId(solutionId);
        if (dtls != null && dtls.size() > 0) {
            deleteAll(dtls);
        }
        return true;
    }

    @Override
    public List<SsAcctGainDtl> listBySoluIdAndIntTxnCd(long solutionId, String intTxnCd) {
        //本方案明细不涉及交易码，不支持本方法
        throw new UnsupportedOperationException("Solution Dtl [SsAcctGainDtl] does not support Operation With IntTxnCd");
    }

    @Override
    public boolean delBySoluIdAndIntTxnCd(long solutionId, String intTxnCd) {
        //本方案明细不涉及交易码，不支持本方法
        throw new UnsupportedOperationException("Solution Dtl [SsAcctGainDtl] does not support Operation With IntTxnCd");
    }
}
